package game;

import java.util.ArrayList;
import java.util.List;

public class Player {

	//VARIABLES
	private int pScore;
	private String pName;
	private List<RPSEnum> pMoves;

	//CONSTRUCTOR
	public Player(int pScore, String pName, List<RPSEnum> pMoves) 
	{
		this.pScore = pScore;
		this.pName = pName;
		this.pMoves = pMoves;
	}

	//CONSTRUCTOR
	public Player(String pName) 
	{
		this.pScore = 0;
		this.pName = pName;
		this.pMoves = new ArrayList<RPSEnum>();
		for (int i = 0; i < 20; i++) 
		{
			int r = (int) (Math.random() * (2));
			switch (r) 
			{
				case 0:
					this.pMoves.add(RPSEnum.PAPER);
					break;
				case 1:
					this.pMoves.add(RPSEnum.SCISSORS);
					break;
				case 2:
					this.pMoves.add(RPSEnum.ROCK);
					break;
				default:
					break;
			}
		}
	}

	//GETTERS & SETTERS
	public int getPScore() {
		return this.pScore;
	}
	
	public void setPScore(int newScore) {
		this.pScore = newScore;
	}
	
	public String getPName() {
		return this.pName;
	}
	
	public void setPName(String newName) {
		this.pName = newName;
	}

	public int getRPSEnumLength() {
		return this.pMoves.size();
	}

	public RPSEnum getMove() {
		return pMoves.listIterator().next();
	}

}
